from collections.abc import Mapping, Sequence

from .device import AbsInfo
from .events import AbsEvent, InputEvent, KeyEvent, RelEvent, SynEvent

def list_devices(input_device_dir: str = ...) -> list[str]: ...
def is_device(fn: str) -> bool: ...
def categorize(event: InputEvent) -> AbsEvent | KeyEvent | RelEvent | SynEvent | InputEvent: ...
def resolve_ecodes_dict(
    typecodemap: Mapping[int, Sequence[int | tuple[int, AbsInfo]]],
    unknown: str = ...,
) -> dict[tuple[str, int], list[tuple[str, int] | tuple[tuple[str, int], AbsInfo]]]: ...
def resolve_ecodes(
    ecode_dict: Mapping[int, Sequence[str]],
    ecode_list: Sequence[int],
    unknown: str = ...,
) -> list[tuple[list[str] | str, int]]: ...
def find_ecodes_by_regex(regex: str) -> dict[int, list[int]]: ...
